package db.tables;

import java.sql.SQLException;

import org.hsqldb.Types;

import db.DBObject;

public class DBActivityTable extends DBObject {
	public static final String TABLE_NAME="activity";
	
	public static final String ACTIVITY_ID_COL = TABLE_NAME+"_id",
			ACTIVITY_NAME_COL = TABLE_NAME+"_name",
			TOWN_ID_COL = DBTownTable.TOWN_ID_COL,
			CATEGORY_ID_COL = DBCategoryTable.CATEGORY_ID_COL;

	public DBActivityTable() throws ClassNotFoundException, SQLException {
		super(TABLE_NAME, new Object[][] {
				{ ACTIVITY_ID_COL, Types.BIGINT, SQL_IDENTITY_PRIMARY_KEY, "" },
				{ ACTIVITY_NAME_COL, Types.VARCHAR, SQL_NOT_NULL, "" },
				{ TOWN_ID_COL, Types.BIGINT, "", "" },
				{ CATEGORY_ID_COL, Types.BIGINT, 
					getSQLForeignKeyReference(DBCategoryTable.TABLE_NAME, CATEGORY_ID_COL)
					+getSQLForeignKeyReference(DBTownTable.TABLE_NAME, TOWN_ID_COL),"" }});
	}
}
